home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / boot / scsiDiskBoot / RCS / fsOpTable.h,v < prev    next >
Encoding:
Text File  |  1989-06-10  |  5.2 KB  |  229 lines

  1. head     1.4;
  2. branch   ;
  3. access   ;
  4. symbols  ;
  5. locks    mendel:1.4; strict;
  6. comment  @ * @;
  7.  
  8.  
  9. 1.4
  10. date     87.05.12.12.45.24;  author brent;  state Exp;
  11. branches ;
  12. next     1.3;
  13.  
  14. 1.3
  15. date     87.05.11.11.32.13;  author brent;  state Exp;
  16. branches ;
  17. next     1.2;
  18.  
  19. 1.2
  20. date     87.05.08.17.46.52;  author brent;  state Exp;
  21. branches ;
  22. next     1.1;
  23.  
  24. 1.1
  25. date     87.05.08.12.06.18;  author brent;  state Exp;
  26. branches ;
  27. next     ;
  28.  
  29.  
  30. desc
  31. @Boot version of fsOpTable.h - Switch tables for IO routines.
  32. @
  33.  
  34.  
  35. 1.4
  36. log
  37. @Working version for scsi disk and tape
  38. @
  39. text
  40. @/*
  41.  * fsOpTable.h --
  42.  *
  43.  *    Boot program operation switches
  44.  *
  45.  * Copyright 1986 Regents of the University of California
  46.  * All rights reserved.
  47.  *
  48.  *
  49.  * $Header: fsOpTable.h,v 1.3 87/05/11 11:32:13 brent Exp $ SPRITE (Berkeley)
  50.  */
  51.  
  52. #ifndef _FSOPTABLE
  53. #define _FSOPTABLE
  54.  
  55. /*
  56.  *    Raw, (ie. no understanding of an underlying filesystem block structure)
  57.  *    device operations.
  58.  */
  59.  
  60. typedef struct FsRawDeviceOps {
  61.     int         type;    /* One of the device types. */
  62.     ReturnStatus (*readWrite)();
  63. } FsRawDeviceOps;
  64.  
  65. extern FsRawDeviceOps fsRawDeviceOpsTable[];
  66.  
  67. /*
  68.  * FsRawDeviceRead --
  69.  *    Byte interface to read raw devices.
  70.  */
  71. #define FsRawDeviceRead(devicePtr, offset, numBytes, buf, lenPtr) \
  72.     (*fsRawDeviceOpsTable[(devicePtr)->type].readWrite) \
  73.     (FS_READ, devicePtr, offset, numBytes, buf, lenPtr)
  74. #ifdef comment
  75.     Fs_Device *devicePtr;    /* Device to to I/O to */
  76.     int offset;            /* Byte offset of I/O operation */
  77.     int numBytes;        /* Byte count */
  78.     Address buf;        /* I/O buffer */
  79.     int *lenPtr;        /* Amount actually transfered */
  80. #endif comment
  81. /*
  82.  * FsRawDeviceWrite --
  83.  *    Byte interface to write raw devices.
  84.  */
  85. #define FsRawDeviceWrite(devicePtr, offset, numBytes, buf, lenPtr) \
  86.     (*fsRawDeviceOpsTable[(devicePtr)->type].readWrite) \
  87.     (FS_WRITE, devicePtr, offset, numBytes, buf, lenPtr)
  88. #ifdef comment
  89.     Fs_Device *devicePtr;    /* Device to to I/O to */
  90.     int offset;            /* Byte offset of I/O operation */
  91.     int numBytes;        /* Byte count */
  92.     Address buf;        /* I/O buffer */
  93.     int *lenPtr;        /* Amount actually transfered */
  94. #endif comment
  95.  
  96.  
  97.  
  98. /*
  99.  * The filesystem block I/O operation switch.
  100.  */
  101. typedef struct FsBlockOps {
  102.     int     deviceType;        /* Redundant device type info */
  103.     ReturnStatus (*init)();        /* Initialization procedure */
  104.     ReturnStatus (*readWrite)();    /* Block read/write routine */
  105. } FsBlockOps;
  106.  
  107. extern FsBlockOps fsBlockOpsTable[];
  108.  
  109. /*
  110.  * FsBlockIO --
  111.  *    A device specific Block I/O routine is used to read or write
  112.  *    filesystem blocks on a disk.  Its maps from filesystem
  113.  *    block indexes to disk addresses and does the I/O.
  114.  */
  115. #define FsBlockIO(readWriteFlag, devicePtr, blockNumber, numBlocks, buf) \
  116.     (*fsBlockOpsTable[(devicePtr)->type].readWrite) \
  117.     (readWriteFlag, devicePtr, blockNumber, numBlocks, buf)
  118. #ifdef comment
  119.     int readWriteFlag;        /* FS_READ or FS_WRITE */
  120.     Fs_Device *devicePtr;    /* Device to to I/O to */
  121.     int blockNumber;        /* CAREFUL, fragment index, not block index */
  122.     int numBlocks;        /* CAREFUL, number of fragments, not blocks */
  123.     Address buf;        /* I/O buffer */
  124. #endif comment
  125.  
  126. /*
  127.  * Known device types.  These need to start at zero as they are used
  128.  * to index into I/O switch tables.
  129.  */
  130.  
  131. #define    FS_DEV_SCSI_DISK    0
  132. #define    FS_DEV_SCSI_TAPE    1
  133. #define FS_DEV_XYLOGICS        2
  134.  
  135. /*
  136.  * Forward Declarations.
  137.  */
  138.  
  139. ReturnStatus NullProc();
  140. ReturnStatus FsNoProc();
  141. ReturnStatus FsNoDevice();
  142.  
  143. #endif _FSOPTABLE
  144. @
  145.  
  146.  
  147. 1.3
  148. log
  149. @Version for all devices
  150. @
  151. text
  152. @d10 1
  153. a10 1
  154.  * $Header: fsOpTable.h,v 1.2 87/05/08 17:46:52 brent Exp $ SPRITE (Berkeley)
  155. d34 1
  156. a34 1
  157.     (FS_READ, devicePtr->unit, offset, numBytes, buf, lenPtr)
  158. @
  159.  
  160.  
  161. 1.2
  162. log
  163. @Added stuff for Xylogics, fixed the RawDeviceOpsTable
  164. @
  165. text
  166. @d10 1
  167. a10 1
  168.  * $Header: fsOpTable.h,v 1.1 87/05/08 12:06:18 brent Exp $ SPRITE (Berkeley)
  169. a15 1
  170.  
  171. a16 28
  172.  * The filesystem block I/O operation switch.
  173.  */
  174. typedef struct FsBlockOps {
  175.     int     deviceType;        /* Redundant device type info */
  176.     ReturnStatus (*init)();        /* Initialization procedure */
  177.     ReturnStatus (*readWrite)();    /* Block read/write routine */
  178. } FsBlockOps;
  179.  
  180. extern FsBlockOps fsBlockOpsTable[];
  181.  
  182. /*
  183.  * FsBlockIO --
  184.  *    A device specific Block I/O routine is used to read or write
  185.  *    filesystem blocks on a disk.  Its maps from filesystem
  186.  *    block indexes to disk addresses and does the I/O.
  187.  */
  188. #define FsBlockIO(readWriteFlag, devicePtr, blockNumber, numBlocks, buf) \
  189.     (*fsBlockOpsTable[(devicePtr)->type].readWrite) \
  190.     (readWriteFlag, devicePtr, blockNumber, numBlocks, buf)
  191. #ifdef comment
  192.     int readWriteFlag;        /* FS_READ or FS_WRITE */
  193.     Fs_Device *devicePtr;    /* Device to to I/O to */
  194.     int blockNumber;        /* CAREFUL, fragment index, not block index */
  195.     int numBlocks;        /* CAREFUL, number of fragments, not blocks */
  196.     Address buf;        /* I/O buffer */
  197. #endif comment
  198.  
  199. /*
  200. d33 2
  201. a34 2
  202.     (*fsRawDeviceOpsTable[(devicePtr)->type].read) \
  203.     (devicePtr, offset, numBytes, buf, lenPtr)
  204. d47 2
  205. a48 2
  206.     (*fsRawDeviceOpsTable[(devicePtr)->type].write) \
  207.     (devicePtr, offset, numBytes, buf, lenPtr)
  208. d55 30
  209. @
  210.  
  211.  
  212. 1.1
  213. log
  214. @Initial revision
  215. @
  216. text
  217. @d10 1
  218. a10 1
  219.  * $Header: fsOpTable.h,v 1.20 86/07/15 12:05:19 brent Exp $ SPRITE (Berkeley)
  220. d52 1
  221. a52 2
  222.     ReturnStatus (*read)();
  223.     ReturnStatus (*write)();
  224. d87 2
  225. a88 1
  226.  * Known device types.
  227. d93 1
  228. @
  229.